//
//  KXConst.swift
//  KXBook
//
//  Created by  on 2022/9/7.
//

import UIKit
//MARK: - 获取屏幕大小
let kUIScreenSize = UIScreen.main.responds(to: #selector(getter: UIScreen.nativeBounds)) ? CGSize(width: UIScreen.main.nativeBounds.size.width / UIScreen.main.nativeScale, height: UIScreen.main.nativeBounds.size.height / UIScreen.main.nativeScale) : UIScreen.main.bounds.size
let kUIScreenWidth = kUIScreenSize.width
let kUIScreenHeight = kUIScreenSize.height
let kUIScreenBounds = UIScreen.main.bounds

//MARK: - 判断屏幕尺寸
let kSCREEN_MAX_LENGTH = max(kUIScreenWidth, kUIScreenHeight)
let kSCREEN_MIN_LENGTH = min(kUIScreenWidth, kUIScreenHeight)

//MARK: - 机型判断
let kUI_IPHONE = (UIDevice.current.userInterfaceIdiom == .phone)
let kUI_IPHONE5 = (kUI_IPHONE && kSCREEN_MAX_LENGTH == 568.0)
let kUI_IPHONE6 = (kUI_IPHONE && kSCREEN_MAX_LENGTH == 667.0)
let kUI_IPHONEPLUS = (kUI_IPHONE && kSCREEN_MAX_LENGTH == 736.0)
let kUI_IPHONEX = (kUI_IPHONE && kSCREEN_MAX_LENGTH > 780.0)
let gap : CGFloat = 10.0
//MARK: - 获取状态栏、标题栏、导航栏高度
let kUIStatusBarHeight: CGFloat = UIApplication.shared.statusBarFrame.size.height
let kUINavigationBarHeight: CGFloat =  kUI_IPHONEX ? 88 : 64
let KUITabBarHeight: CGFloat = kUI_IPHONEX ? 83 : 49

func LS(_ s : String)->String
{
    return NSLocalizedString(s, comment: "")
}
var APP : AppDelegate = UIApplication.shared.delegate as! AppDelegate
class KXConst: NSObject {
    @objc static let baseurl = "http://wrinter1.top:8085"
    @objc static let api_login = "/common/login"
    @objc static let api_register = "/common/register"
    @objc static let api_delUser = "/common/delUser"
    @objc static let api_updateAvatat = "/common/updateHeadImg"
    @objc static let api_updatePSW = "/common/updatePassword"
    @objc static let api_updateName = "/common/updateUsername"
    @objc static let api_upload = "/common/uploadImage"
    @objc static let api_userinfo = "/common/userInfo"
    @objc static let api_city = "http://apis.juhe.cn/simpleWeather/cityList"
    @objc static let api_weather = "http://apis.juhe.cn/simpleWeather/query"
    @objc static let api_img = "http://service.picasso.adesk.com/v1/vertical/category"
    @objc static let kkey = "767e2d63d51b8e35990b5d1bc6f94f3d"
}
